<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_validator = $show_scroll = $show_dialog = 1;
include $this->admin_tpl('header', 'admin');

?>
<h3 style="padding-left: 20px;padding-top: 10px">
	<?php echo $course_info['name']?>——报名信息
	<a href="?m=course_nsr&c=manage&a=init" style="font-size:14px;color: #0000FF"><em>返回上一级</em></a>
</h3>
<div class="subnav">
</div>
<div class="pad-lr-10">

	<form name="searchform" action="" method="get">
		<input type="hidden" value="course_nsr" name="m">
		<input type="hidden" value="information" name="c">
		<input type="hidden" value="init" name="a">
		<input type="hidden" value="<?php echo $course_id?>" name="course_id">
		<table width="100%" cellspacing="0" class="search-form">
			<tbody>
			<tr>
				<td>
					<div class="explain-col">

						报名姓名：
						<input name="keyword" type="text" value="<?php if(isset($_GET['keyword'])) {echo $_GET['keyword'];}?>"
							   class="input-text" />
						<input type="submit" name="search"  class="button" value="<?php echo L('search')?>" />
					</div>


				</td>
			</tr>
			</tbody>
		</table>
	</form>

	<form name="myform" action="?m=contest&c=process&a=del" method="post" onsubmit="return confirm('<?php echo L('confirm')?>')">
		<div class="table-list">
			<table width="100%" cellspacing="0">
				<thead>
				<tr>
					<th align="left" width="20"><input type="checkbox" value=""
													   id="check_box" onclick="selectall('id[]');"></th>
					<th align="left">ID</th>
					<th align="left"><?php echo L('realname')?></th>
					<th align="left"><?php echo L('gender')?></th>
					<th align="left"><?php echo L('age')?></th>
					<th align="left"><?php echo L('image_square')?></th>
					<th align="left"><?php echo L('telephone')?></th>
					<th align="left"><?php echo L('import_talent')?></th>
					<th align="left"><?php echo L('operation')?></th>
				</tr>
				</thead>
				<tbody>
				<?php
					if(!empty($info)){
						foreach ($info as $k => $v) {
					?>
					<tr>
						<td align="left"><input type="checkbox"
												value="<?php echo $v['id']?>" name="id[]"></td>
						<td align="left"><?php echo $v['id']?></td>
						<td align="left"><?php echo $v['real_name']?></td>
						<td align="left"><?php  if(empty($v['gender'])){echo"<span style='color:red;'>（未设置）</span>";}else{if($v['gender']==1){echo '男';}elseif ($v['gender']==2){echo '女';}elseif($v['gender']==3){echo '保密';}}?></td>
						<td align="left"><?php if(empty($v['age'])){echo"<span style='color:red;'>（未设置）</span>";}else{echo $v['age'];}?></td>
						<td align="left"><?php if(!empty($v['image_square'])){?><img src="<?php echo $v['image_square'];?>" height="60"/><?php }else{echo"<span style='color:red;'>（未设置）</span>";}?></td>
						<td align="left"><?php if(empty($v['telephone'])){echo"<span style='color:red;'>（未设置）</span>";}else{echo $v['telephone'];}?></td>
						<td align="left"><?php if(empty($v['status'])){echo"<span style='color:red;'>（未设置）</span>";}else{if($v['status']==1){echo "<font color='green'>尚处于报名阶段！</font>";}else if($v['status']==3){echo "<font color='red'>已转为学员！</font>";}else{echo "<font color='red'>请联系管理员！</font>";}}?></td>
						<td align="left">
							<a  href="javascript:detail(<?php echo $v['id']?>, '<?php echo  new_addslashes(new_html_special_chars($v['real_name']))?>')">
								[详情]
							</a>
							<?php if($v['status']==1) {?>
							<br>
							<a href="?m=course_nsr&c=information&a=handle&course_id=<?php echo $_GET['course_id']?>&id=<?php echo $v['id']?>" onClick="return confirm('<?php echo "确认进行该操作？"?>')">
								[<?php echo L('import_talent_student')?>]
							</a>
							<?php }?>

						</td>
					</tr>
				<?php
					}
				}else{
				    echo "<tr><td colspan='10' style='color:red;font-size:18px;text-align:center;'><span>暂无数据！</span></td></tr>";
				}
				?>
				</tbody>
			</table>


			<div id="pages"><?php echo $pages?></div>
		</div>
	</form>
	</div>
<script type="text/javascript">

	function detail(id, name) {
		window.top.art.dialog({id:'detail'}).close();
		window.top.art.dialog({
				title: name,
				id: 'detail',
				iframe: '?m=course_nsr&c=information&a=detail&id=' + id,
				width: '1200',
				height: '800'
			},
// 			function() {
// 				var d = window.top.art.dialog({
// 					id: 'detail'
// 				}).data.iframe;
// 				d.document.getElementById('dosubmit').click();
// 				return false;
// 			},
			function() {
				window.top.art.dialog({
					id: 'detail'
				}).close()
			});
	}

</script>
</body>
</html>